package com.ruoyi.media.publishRecord.mapper;

import com.ruoyi.media.publishRecord.domain.MediaPublishRecord;
import com.ruoyi.media.publishRecord.domain.vo.MediaPublishRecordVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 视频号发布记录Mapper接口
 *
 * @author dqw
 * @date 2023-05-14
 */
public interface MediaPublishRecordMapper extends BaseMapperPlus<MediaPublishRecordMapper, MediaPublishRecord, MediaPublishRecordVo> {

    /**
     *  获取未发布账号的最新一条数据
     * @return
     */
    @Select("SELECT * FROM `media_publish_record` WHERE publish_status = 0 AND create_by = #{username} AND del_flag = 0 ORDER BY create_time LIMIT 1")
    MediaPublishRecord getPublishData(@Param("username") String username);


}
